home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / asa / user.h < prev   
C/C++ Source or Header  |  1994-10-23  |  4KB  |  166 lines

  1.  /* $Id: user.h,v 4.2 1994/10/23 23:35:15 ingber Exp ingber $ */
  2.  
  3.  /* user.h for Adaptive Simulated Annealing */
  4.  
  5. #include "asa_user.h"
  6.  
  7.  /* print the time every PRINT_FREQUENCY function evaluations
  8.     Define PRINT_FREQUENCY to 0 to not print out the time. */
  9. #define PRINT_FREQUENCY ((LONG_INT) 1000)
  10.  
  11. FILE *ptr_out;
  12.  
  13.  /* system function prototypes */
  14. #if HAVE_ANSI
  15.  
  16. /* This block gives trouble under some Ultrix */
  17. #if FALSE
  18. #if OPTIONS_FILE
  19. int fscanf (FILE * fp, char *string,...);
  20. #endif
  21. #endif
  22.  
  23. #if IO_PROTOTYPES
  24. #if OPTIONS_FILE
  25. int fscanf ();
  26. #endif
  27. #endif
  28.  
  29.  /* user-defined */
  30. double cost_function (double *cost_parameters,
  31.               double *parameter_lower_bound,
  32.               double *parameter_upper_bound,
  33.               double *cost_tangents,
  34.               double *cost_curvature,
  35.               ALLOC_INT * parameter_dimension,
  36.               int *parameter_int_real,
  37.               int *cost_flag,
  38.               int *exit_code,
  39.               USER_DEFINES * USER_OPTIONS);
  40. #if ASA_LIB
  41. int asa_main ();
  42. #else
  43. int main (int argc, char **argv);
  44. #endif
  45.  
  46.  /* possibly with accompanying data file */
  47. void initialize_parameters (double *cost_parameters,
  48.                 double *parameter_lower_bound,
  49.                 double *parameter_upper_bound,
  50.                 double *cost_tangents,
  51.                 double *cost_curvature,
  52.                 ALLOC_INT * parameter_dimension,
  53.                 int *parameter_int_real,
  54.                 USER_DEFINES * USER_OPTIONS);
  55.  
  56. double myrand (void);
  57. double randflt (void);
  58. void initialize_rng (void);
  59.  
  60. #if USER_COST_SCHEDULE
  61. double user_cost_schedule (double test_temperature,
  62.                USER_DEFINES * USER_OPTIONS);
  63. #endif
  64.  
  65. #if USER_REANNEAL_FUNCTION
  66. double user_reanneal (double current_temp,
  67.               double tangent,
  68.               double max_tangent,
  69.               USER_DEFINES * USER_OPTIONS);
  70. #endif
  71.  
  72. #if ASA_SAMPLE
  73. #if ASA_TEMPLATE
  74. void sample (FILE * ptr_out, FILE * ptr_asa);
  75. #endif
  76. #endif
  77.  
  78. #else /* HAVE_ANSI */
  79.  
  80. #if IO_PROTOTYPES
  81. #if OPTIONS_FILE
  82. int fscanf ();
  83. #endif
  84. #endif
  85.  
  86.  /* user-defined */
  87. double cost_function ();
  88. #if ASA_LIB
  89. int asa_main ();
  90. #else
  91. int main ();
  92. #endif
  93. void initialize_parameters ();    /* possibly with accompanying
  94.                    data file */
  95. double myrand ();
  96. double randflt ();
  97. void initialize_rng ();
  98.  
  99. #if USER_COST_SCHEDULE
  100. double user_cost_schedule ();
  101. #endif
  102.  
  103. #if USER_REANNEAL_FUNCTION
  104. double user_reanneal ();
  105. #endif
  106.  
  107. #if ASA_SAMPLE
  108. #if ASA_TEMPLATE
  109. void sample ();
  110. #endif
  111. #endif
  112. #endif /* HAVE_ANSI */
  113.  
  114. #if SELF_OPTIMIZE
  115. static LONG_INT funevals = 0;
  116. #define RECUR_PRINT_FREQUENCY ((LONG_INT) 1)
  117.  
  118. #if HAVE_ANSI            /* HAVE_ANSI SELF_OPTIMIZE */
  119. double recur_cost_function (double *recur_cost_parameters,
  120.                 double *recur_parameter_lower_bound,
  121.                 double *recur_parameter_upper_bound,
  122.                 double *recur_cost_tangents,
  123.                 double *recur_cost_curvature,
  124.                 ALLOC_INT * recur_parameter_dimension,
  125.                 int *recur_parameter_int_real,
  126.                 int *recur_cost_flag,
  127.                 int *recur_exit_code,
  128.                 USER_DEFINES * RECUR_USER_OPTIONS);
  129.  
  130. void recur_initialize_parameters (double *recur_cost_parameters,
  131.                   double *recur_parameter_lower_bound,
  132.                   double *recur_parameter_upper_bound,
  133.                   double *recur_cost_tangents,
  134.                   double *recur_cost_curvature,
  135.                   ALLOC_INT * recur_parameter_dimension,
  136.                   int *recur_parameter_int_real,
  137.                   USER_DEFINES * RECUR_USER_OPTIONS);
  138.  
  139. #if USER_COST_SCHEDULE
  140. double recur_user_cost_schedule (double test_temperature,
  141.                  USER_DEFINES * RECUR_USER_OPTIONS);
  142. #endif
  143.  
  144. #if USER_REANNEAL_FUNCTION
  145. double recur_user_reanneal (double current_temp,
  146.                 double tangent,
  147.                 double max_tangent,
  148.                 USER_DEFINES * RECUR_USER_OPTIONS);
  149. #endif
  150.  
  151. #else /* HAVE_ANSI SELF_OPTIMIZE */
  152.  
  153. double recur_cost_function ();
  154. void recur_initialize_parameters ();
  155.  
  156. #if USER_COST_SCHEDULE
  157. double recur_user_cost_schedule ();
  158. #endif
  159.  
  160. #if USER_REANNEAL_FUNCTION
  161. double recur_user_reanneal ();
  162. #endif
  163.  
  164. #endif /* HAVE_ANSI SELF_OPTIMIZE */
  165. #endif /* SELF_OPTIMIZE */
  166.